package edu.ynu.se.xiecheng.achitectureclass.nongye.entity;

import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

@Getter
@Setter
@Entity
@Table(name = "device")
public class Device extends LogicEntity {

    @Column(name = "name", nullable = false, length = 100)
    private String name;

    @Column(name = "box_id", nullable = false, length = 20)
    private String boxId;  // 去除唯一约束，允许重复

    @Column(name = "type", nullable = false)
    private int type;

    @Column(name = "unit", length = 50)
    private String unit;

    @Column(name = "address", length = 255)
    private String address;

    @Column(name = "greenhouse_id", length = 20)
    private String greenhouseId;  // 外键，关联大棚ID，去除唯一约束，允许重复

    @Column(name = "time")
    private java.util.Date time;

}
